package com.ruoyi.check.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.check.mapper.SysProblemMapper;
import com.ruoyi.check.domain.SysProblem;
import com.ruoyi.check.service.ISysProblemService;

/**
 * 检点项Service业务层处理
 *
 * @author hugh.sun
 * @date 2023-02-22
 */
@Service
public class SysProblemServiceImpl implements ISysProblemService
{
    @Autowired
    private SysProblemMapper sysProblemMapper;

    /**
     * 查询检点项
     *
     * @param id 检点项主键
     * @return 检点项
     */
    @Override
    public SysProblem selectSysProblemById(Long id)
    {
        return sysProblemMapper.selectSysProblemById(id);
    }

    /**
     * 查询检点项列表
     *
     * @param sysProblem 检点项
     * @return 检点项
     */
    @Override
    public List<SysProblem> selectSysProblemList(SysProblem sysProblem)
    {
        return sysProblemMapper.selectSysProblemList(sysProblem);
    }

    /**
     * 新增检点项
     *
     * @param sysProblem 检点项
     * @return 结果
     */
    @Override
    public int insertSysProblem(SysProblem sysProblem)
    {
        return sysProblemMapper.insertSysProblem(sysProblem);
    }

    /**
     * 修改检点项
     *
     * @param sysProblem 检点项
     * @return 结果
     */
    @Override
    public int updateSysProblem(SysProblem sysProblem)
    {
        return sysProblemMapper.updateSysProblem(sysProblem);
    }

    /**
     * 批量删除检点项
     *
     * @param ids 需要删除的检点项主键
     * @return 结果
     */
    @Override
    public int deleteSysProblemByIds(Long[] ids)
    {
        return sysProblemMapper.deleteSysProblemByIds(ids);
    }

    /**
     * 删除检点项信息
     *
     * @param id 检点项主键
     * @return 结果
     */
    @Override
    public int deleteSysProblemById(Long id)
    {
        return sysProblemMapper.deleteSysProblemById(id);
    }

    @Override
    public List<SysProblem>findNameAndType (String name){
        //拿到对应的problem表的名字和类型
        List<SysProblem> nameAndType = sysProblemMapper.findNameAndType(name);

        return  nameAndType;
    }

}
